<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:f="http://java.sun.com/jsf/core">
    <body>

        <ui:composition template="./UserTemplate.xhtml">


            <ui:define name="content">
                <center>
                    <h1><b>Register!</b></h1>
                    <p>&nbsp;</p>
                    <table width="604" height="413" border="0" cellpadding="0" cellspacing="0">

                        <tr>
                            <th width="114"><div align="left"><span>Email *</span></div></th>
                            <td width="328"><p:inputText id="email" value="#{customerBean.cu.email}" required="true" requiredMessage="Email is not null">
                                    <f:validator validatorId="Validator.EmailValidator"/>
                                    <f:ajax event="change" execute="email" listener="#{customerBean.checkCustomerEmail}"/>
                                </p:inputText>
                                <h:outputText id="display" value="#{customerBean.msEmail}" style="font-size: smaller;font-weight: normal;color: red"/>
                                <h:messages for="email" style="font-size: smaller;font-weight: normal;color: red"/>
                            </td>

                        </tr>
                        <tr>
                            <th height="35"><div align="left"><span>Password *</span></div></th>
                            <td><p:password feedback="" minLength="6" id="password" value="#{customerBean.cu.password}" required="true" requiredMessage="Password is not null"/>
                                <h:messages for="password" style="font-size: smaller;font-weight: normal;color: red"/>

                            </td>
                        </tr>
                       <!-- <tr>
                            <th height="35"><div align="left"><span>Confirm Password *</span></div></th>
                            <td><p:password feedback="" minLength="6" id="cpassword" value="" required="true" requiredMessage="Confirm Password is not null">
                                    <f:validator validatorId="Validator.PasswordValidator"/>
                                </p:password>
                                <h:messages for="cpassword" style="font-size: smaller;font-weight: normal;color: red"/>

                            </td>
                        </tr>-->
                        <tr>
                            <th><div align="left"><span>Full Name *</span></div></th>
                            <td><p:inputText  id="txtfullname" value="#{customerBean.cu.fullName}" required="true" requiredMessage="FullName is not null">
                                    <f:validator validatorId="Validator.StringValidator"/></p:inputText>
                                <h:messages for="txtfullname" style="font-size: smaller;font-weight: normal;color: red"/>

                            </td>
                        </tr>
                        <tr>
                            <th height="98"><div align="left"><span>Address *</span></div></th>
                            <td><p:editor id="address" value="#{customerBean.cu.address}" required="true" requiredMessage="Address is not null"/>
                                <h:messages for="address" style="font-size: smaller;font-weight: normal;color: red"/>

                            </td>
                        </tr>
                        <tr>
                            <th><div align="left"><span>Phone *</span></div></th>
                            <td><p:inputText  id="phone" value="#{customerBean.cu.phone}" required="true" requiredMessage="Phone is not null">
                                   <f:validator validatorId="Validator.PhoneValidator"/></p:inputText>
                                <h:messages for="phone" style="font-size: smaller;font-weight: normal;color: red"/>

                            </td>
                        </tr>
                        <tr>
                            <th><div align="left"><span>Age *</span></div></th>
                            <td><p:inputText id="age" value="#{customerBean.cu.age}" required="true" requiredMessage="Age is not null">
                                    <f:validator validatorId="Validator.AgeValidator"/></p:inputText>
                                <h:messages for="age" style="font-size: smaller;font-weight: normal;color: red"/>

                            </td>
                        </tr>
                        <tr>
                            <td></td>
                            <td>  <h:commandButton action="AccountRegister" value="Login" actionListener="#{customerBean.register}" styleClass="submit-login" image="../resources/images/forms/form_submit.gif"/>
                            </td>

                        </tr>

                    </table>

                </center>
            </ui:define>



        </ui:composition>

    </body>
</html>
